package board;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.image.BufferStrategy;

public class MyJPanel extends JPanel {
	
	   Image dice[] = new Image[6];
	   int die1, die2, result;
	   boolean begin = true;
	  
	   public void setImages(Image d[])
	   {
	      dice = d;
	   }

	   public void setAll(int d1, int d2, int r, boolean b)
	   {
	      die1 = d1;
	      die2 = d2;
	      result = r;
	      begin = b;
	   } 

	   // Does the drawing as in our earlier MyJPanel
	   public void paint(Graphics g)
	   {
	      super.paintComponent(g);
	      Graphics2D g2 = (Graphics2D)g;
	      
	      if (!begin)
	      {  
	         g2.drawImage(dice[die1 - 1], 20, 45, this);
	         g2.drawImage(dice[die2 - 1], 160, 45, this);
	      }
	      else 
	         g2.drawString("Click the roll Button to Begin", 20, 60);
	   }      
	
}